@extends('common')
@section('content')
    <style type="text/css">
        span{
            margin-left: 20px;
        }
        ul li{
            float: left;
            margin-left: 20px;
            list-style-type: none;
        }
        ul li span{
            display:inline-block;
            margin-left:5px;
            width:20px;
            height:13px;
            border: 1px solid #333;
        }
    </style>
    <form class="form-inline definewidth m20" action="index.html" method="get">
         教练姓名：
         <input type="text" name="use_name" class="abc input-default" placeholder="如：张三" value="">&nbsp;&nbsp;
         排课日期：
        <input type="text" name="c_monch" id="indate" >&nbsp;&nbsp;
        <button type="submit" class="btn btn-primary">查询</button>
     </form>
    <br />
    <ul>
        <li style="margin-left: 0">未预约<span style="background: #fff"></span></li>
        <li>违约<span style="background: #FF0000"></span></li>
        <li>场内训练<span style="background: #009900"></span></li>
        <li>独立驾驶<span style="background: #01FF33"></span></li>
        <li>场内考核<span style="background: #00CC66"></span></li>
        <li>场外训练<span style="background: #FFFF00"></span></li>
        <li>同车互动<span style="background: #FFCC66"></span></li>
        <li>场外考核<span style="background: #FFCC99"></span></li>
        <li>不可预约<span style="background: #999"></span></li>
    </ul>
    <br /><br />
    <span style="color:red;margin-left: 20px">已排课的显示 </span>
    <table class="table table-bordered table-hover definewidth m10" style="margin-left:10px;">
        <th>教练</th>
        <th>使用车辆</th>
        <th>7:00-8:00</th>
        <th>8:00-9:00</th>
        <th>9:00-10:00</th>
        <th>10:00-11:00</th>
        <th>11:00-12:00</th>
        <th>12:30-13:30</th>
        <th>13:30-14:30</th>
        <th>14:30-15:30</th>
        <th>15:30-16:30</th>
        <th>16:30-17:30</th>
        <th>18:00-19:00</th>
        <th>19:00-20:00</th>
        <th>20:00-21:00</th>
        @foreach($arr as $v)
        <tr>
            <td>{{$v['use_name']}}</td>
            <td>{{$v['c_num']}}</td>
            @foreach($v['ord_stu_id'] as $key=>$val)
                @if($v['ca_state'][$key]==0)
                    <td>未预约</td>
                    @else
                    <td style="background:@if($v['ca_state'][$key]==1){{'#FF0000'}}
                            @elseif($v['ca_state'][$key]==2){{'#009900'}}
                    @elseif($v['ca_state'][$key]==3){{'#01FF33'}}
                    @elseif($v['ca_state'][$key]==4){{'#00CC66'}}
                    @elseif($v['ca_state'][$key]==5){{'#FFFF00'}}
                    @elseif($v['ca_state'][$key]==6){{'#FFCC66'}}
                    @elseif($v['ca_state'][$key]==7){{'#FFCC99'}}
                    @elseif($v['ca_state'][$key]==8){{'#999'}}
                    @endif">{{$val}}</td>
                @endif
            @endforeach
        </tr>
        @endforeach
    </table>
    <br />
    <br />
    <!--<span style="color:red;margin-left: 20px">未排课的显示</span>
    <table class="table table-bordered table-hover definewidth m10" style="margin-left:10px;">
        <th>教练</th>
        <th>使用车辆</th>
        <th>7:00-8:00</th>
        <th>8:00-9:00</th>
        <th>9:00-10:00</th>
        <th>10:00-11:00</th>
        <th>11:00-12:00</th>
        <th>12:30-13:30</th>
        <th>13:30-14:30</th>
        <th>14:30-15:30</th>
        <th>15:30-16:30</th>
        <th>16:30-17:30</th>
        <th>18:00-19:00</th>
        <th>19:00-20:00</th>
        <th>20:00-21:00</th>
        <tr>
            <td>张三</td>
            <td>贵F3648学</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
            <td>可预约</td>
        </tr>
    </table>-->
    <script src="{{url('api/jedate/jedate.js')}}"></script>
    <script type="text/javascript">
        jeDate({
            dateCell:"#indate",
            format:"YYYY-MM-DD",
            isinitVal:true,
            isTime:true, //isClear:false,
            minDate:"2000-01-01",
            okfun:function(val){alert(val)}
        })
    </script>
@stop